<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.EditAdministradorTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form rendered="#{login.loggedInAdmin}">
                <h:panelGrid columns="2">
                    <h:outputLabel value="#{bundle.EditAdministradorLabel_idAdmin}" for="idAdmin" />
                    <h:inputText id="idAdmin" value="#{administradorController.selected.idAdmin}" title="#{bundle.EditAdministradorTitle_idAdmin}" required="true" requiredMessage="#{bundle.EditAdministradorRequiredMessage_idAdmin}"/>
                    <h:outputLabel value="#{bundle.EditAdministradorLabel_nombreAdmin}" for="nombreAdmin" />
                    <h:inputText id="nombreAdmin" value="#{administradorController.selected.nombreAdmin}" title="#{bundle.EditAdministradorTitle_nombreAdmin}" required="true" requiredMessage="#{bundle.EditAdministradorRequiredMessage_nombreAdmin}"/>
                    <h:outputLabel value="#{bundle.EditAdministradorLabel_email}" for="email" />
                    <h:inputText id="email" value="#{administradorController.selected.email}" title="#{bundle.EditAdministradorTitle_email}" required="true" requiredMessage="#{bundle.EditAdministradorRequiredMessage_email}"/>
                    <h:outputLabel value="#{bundle.EditAdministradorLabel_pass}" for="pass" />
                    <h:inputText id="pass" value="#{administradorController.selected.pass}" title="#{bundle.EditAdministradorTitle_pass}" required="true" requiredMessage="#{bundle.EditAdministradorRequiredMessage_pass}"/>
                </h:panelGrid>
                <h:commandLink action="#{administradorController.update}" value="#{bundle.EditAdministradorSaveLink}"/>
                <br />
                <br />
                <h:link outcome="View" value="#{bundle.EditAdministradorViewLink}"/>
                <br />
                <h:commandLink action="#{administradorController.prepareList}" value="#{bundle.EditAdministradorShowAllLink}" immediate="true"/>
                <br />
                <br />
                <h:link outcome="/index" value="#{bundle.EditAdministradorIndexLink}" />
            </h:form>
            <h:form rendered="#{!login.loggedInAdmin}">
                <h1>#{bundle.AccesDeny}</h1>
                <br />
                <br />
                <h:link outcome="/index" value="#{bundle.ViewUsuariosIndexLink}"/>
            </h:form>
        </ui:define>
    </ui:composition>

</html>
